
import java.util.Scanner;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author XuanHung
 */
public class clsDiem {
    private int m_iX;
    private int m_iY;
    
    public void setX(int _iX){
        m_iX = _iX;
    }
    public int getX(){
        return m_iX;
    }
    public void setY(int _iY){
        m_iY = _iY;
    }
    public int getY(){
        return m_iY;
    }
    public clsDiem(){
        m_iX = 0;
        m_iY = 0;
    }
    public clsDiem(int _iX, int _iY){
        m_iX = _iX;
        m_iY = _iY;
    }
    public static void PhuongTrinhDuongThang(clsDiem p1, clsDiem p2){
        //phuong trinh y = ax + b;
        
    }
    public void NhapDiem(){
        Scanner sn = new Scanner(System.in);
        System.out.println("nhap Toa do x");       
        this.m_iX = sn.nextInt();
        System.out.println("nhap Toa do Y");       
        this.m_iY = sn.nextInt();
    }
    public static void ChuVi(clsDiem d1, clsDiem d2, clsDiem d3){
        float kc  = KhoangCach(d1,d2) + KhoangCach(d2,d3) + KhoangCach(d3,d1);
        System.out.println("Chu Vi la" + kc);
    }
    public static float KhoangCach(clsDiem d1, clsDiem d2){
        float kc;
        kc = (float) Math.sqrt((d1.m_iY - d2.m_iY)*(d1.m_iY - d2.m_iY) + (d1.m_iX - d2.m_iX)*(d1.m_iX - d2.m_iX));
        return kc;
    }
}
